package com.test.demon2;

public class Animal {
    public String name;
    public int age;

    static {
        System.out.println("父类的静态代码块执行了");
    }

    {
        System.out.println("父类的实例代码块执行了");

    }

    public Animal() {
        System.out.println("父类的无参构造方法执行了");
    }

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("父类的构造方法执行了");

    }
}
